#ifndef COMPROTOCOL_H_
#define COMPROTOCOL_H_

#include <inttypes.h>
#include "GlobalDefinitions.h"
#include "Uart.h"
#include "RTC.h"

#define UNKNOWN					0x00
#define SOF_RECEIVED			0x01
#define SYNC_RECEIVED			0x02
#define ID_RECEIVED				0x03
#define DLC_RECEIVED			0x04
#define EOF						0x05

#define SOF						0xAA
#define SYNC					0x55

/* IDs sent from MC to PC */
#define MC_ID_SEND_DATA			1

/* IDs sent from PC to MC */
#define PC_ID_REQ_DATA			1
#define PC_ID_SEND_DATE			2
#define PC_ID_SEND_SUT_DATE		3
#define PC_ID_SEND_DATA         4


typedef volatile struct{
	uint8_t id;
	uint8_t dlc;
	uint8_t data[8];
}Com_Message_struct;


void Com_Message_Tx_create(uint8_t id, uint8_t dlc, uint8_t *data);
void Com_Message_Tx_send(void);
void Com_Message_Rx_process(void);

#endif
